package model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "Company")
public class Company {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "CompanyID", nullable = false)
	private int companyId;
	@Column(name = "CompanyName", nullable = false, length = 100)
	private String companyName;
	@Column(name = "Address", nullable = false, length = 500)
	private String address;
	@Column(name = "PhoneNumber", nullable = false, length = 11)
	private String phoneNumber;
	@Column(name = "ContactPerson", nullable = false, length = 100)
	private String contactPerson;
	@Column(name = "FinancialReport", nullable = true, length = 5000)
	private String financialReport;

	@OneToMany(mappedBy = "company")
	@LazyCollection(LazyCollectionOption.FALSE)
	private Set<Product> listProduct;

	@ManyToOne
	@JoinColumn(name = "CompanyTypeID")
	private CompanyType companyType;

	@Column(name = "NoWorkers", nullable = true)
	private int noWorkers;
	@Column(name = "NoLines", nullable = true)
	private int noLines;
	@Column(name = "NoMachinesLine", nullable = true)
	private int noMachinesLine;
	@Column(name = "NoBranches", nullable = true)
	private int noBranches;
	@Column(name = "WorkshopImagePath", nullable = true, length = 1000)
	private String workshopImagePath;
	@Column(name = "WarehouseImagePath", nullable = true, length = 1000)
	private String warehouseImagePath;
	@Column(name = "CapacityOfDayMonth", nullable = true)
	private float capacityOfDayMonth;
	@Column(name = "TimeTextile", nullable = true)
	private float timeTextile;
	@Column(name = "TimeTextileOrigin", nullable = true)
	private float timeTextileOrigin;
	@Column(name = "IsActive", nullable = false)
	private boolean isActive;
	@Column(name = "Creater", nullable = true, length = 100)
	private String creater;
	@Column(name = "Updater", nullable = true, length = 100)
	private String updater;
	@Column(name = "LastestUpdater", nullable = true, length = 100)
	private String lastestUpdater;
	@Column(name = "Deleter", nullable = true, length = 100)
	private String deleter;
	@Column(name = "DateUpdate", nullable = true, length = 20)
	private String dateUpdate;
	@Column(name = "DateDelete", nullable = true, length = 20)
	private String dateDelete;

	public Company() {
	}

	public Company(int companyId, String companyName, String address,
			String phoneNumber, String contactPerson, String financialReport,
			Set<Product> listProduct, CompanyType companyType, int noWorkers,
			int noLines, int noMachinesLine, int noBranches,
			String workshopImagePath, String warehouseImagePath,
			float capacityOfDayMonth, float timeTextile,
			float timeTextileOrigin, boolean isActive, String creater,
			String updater, String lastestUpdater, String deleter,
			String dateUpdate, String dateDelete) {
		super();
		this.companyId = companyId;
		this.companyName = companyName;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.contactPerson = contactPerson;
		this.financialReport = financialReport;
		this.listProduct = listProduct;
		this.companyType = companyType;
		this.noWorkers = noWorkers;
		this.noLines = noLines;
		this.noMachinesLine = noMachinesLine;
		this.noBranches = noBranches;
		this.workshopImagePath = workshopImagePath;
		this.warehouseImagePath = warehouseImagePath;
		this.capacityOfDayMonth = capacityOfDayMonth;
		this.timeTextile = timeTextile;
		this.timeTextileOrigin = timeTextileOrigin;
		this.isActive = isActive;
		this.creater = creater;
		this.updater = updater;
		this.lastestUpdater = lastestUpdater;
		this.deleter = deleter;
		this.dateUpdate = dateUpdate;
		this.dateDelete = dateDelete;
	}

	public int getCompanyId() {
		return companyId;
	}

	public void setCompanyId(int companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getContactPerson() {
		return contactPerson;
	}

	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}

	public String getFinancialReport() {
		return financialReport;
	}

	public void setFinancialReport(String financialReport) {
		this.financialReport = financialReport;
	}

	public Set<Product> getListProduct() {
		return listProduct;
	}

	public void setListProduct(Set<Product> listProduct) {
		this.listProduct = listProduct;
	}

	public CompanyType getCompanyType() {
		return companyType;
	}

	public void setCompanyType(CompanyType companyType) {
		this.companyType = companyType;
	}

	public int getNoWorkers() {
		return noWorkers;
	}

	public void setNoWorkers(int noWorkers) {
		this.noWorkers = noWorkers;
	}

	public int getNoLines() {
		return noLines;
	}

	public void setNoLines(int noLines) {
		this.noLines = noLines;
	}

	public int getNoMachinesLine() {
		return noMachinesLine;
	}

	public void setNoMachinesLine(int noMachinesLine) {
		this.noMachinesLine = noMachinesLine;
	}

	public int getNoBranches() {
		return noBranches;
	}

	public void setNoBranches(int noBranches) {
		this.noBranches = noBranches;
	}

	public String getWorkshopImagePath() {
		return workshopImagePath;
	}

	public void setWorkshopImagePath(String workshopImagePath) {
		this.workshopImagePath = workshopImagePath;
	}

	public String getWarehouseImagePath() {
		return warehouseImagePath;
	}

	public void setWarehouseImagePath(String warehouseImagePath) {
		this.warehouseImagePath = warehouseImagePath;
	}

	public float getCapacityOfDayMonth() {
		return capacityOfDayMonth;
	}

	public void setCapacityOfDayMonth(float capacityOfDayMonth) {
		this.capacityOfDayMonth = capacityOfDayMonth;
	}

	public float getTimeTextile() {
		return timeTextile;
	}

	public void setTimeTextile(float timeTextile) {
		this.timeTextile = timeTextile;
	}

	public float getTimeTextileOrigin() {
		return timeTextileOrigin;
	}

	public void setTimeTextileOrigin(float timeTextileOrigin) {
		this.timeTextileOrigin = timeTextileOrigin;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public String getUpdater() {
		return updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	public String getLastestUpdater() {
		return lastestUpdater;
	}

	public void setLastestUpdater(String lastestUpdater) {
		this.lastestUpdater = lastestUpdater;
	}

	public String getDeleter() {
		return deleter;
	}

	public void setDeleter(String deleter) {
		this.deleter = deleter;
	}

	public String getDateUpdate() {
		return dateUpdate;
	}

	public void setDateUpdate(String dateUpdate) {
		this.dateUpdate = dateUpdate;
	}

	public String getDateDelete() {
		return dateDelete;
	}

	public void setDateDelete(String dateDelete) {
		this.dateDelete = dateDelete;
	}

	public boolean getIsActive() {
		return isActive;
	}

	public void setIsActive(boolean isActive) {
		this.isActive = isActive;
	}

}
